package com.jxLC.Action;

import com.jxLC.Model.Links;
import com.jxLC.Service.LinkService;
import com.opensymphony.xwork2.ActionSupport;

public class LinkAction extends ActionSupport {
	public Links link ;  
	private int id ;
	
	public String add(){
		LinkService service = new LinkService();
		service.add(link);
		return SUCCESS;
	}
	
	public String toEidt(){
		LinkService service = new LinkService();
		link = service.getLinkById(id);
		return SUCCESS;
	}
	
	public String del(){
		LinkService service = new LinkService();
		service.deleteById(id) ;
		return SUCCESS;
	}
	
	public Links getLink() {
		return link;
	}

	public void setLink(Links link) {
		this.link = link;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	

}
